home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / Bonus / VCLZip / kp222_b4.exe / kpCntn.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-07-23  |  6.3 KB  |  176 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1999 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'kpCntn.pas' rev: 4.00
  6.  
  7. #ifndef kpCntnHPP
  8. #define kpCntnHPP
  9.  
  10. #pragma delphiheader begin
  11. #pragma option push -w-
  12. #include <SysUtils.hpp>    // Pascal unit
  13. #include <Classes.hpp>    // Pascal unit
  14. #include <Windows.hpp>    // Pascal unit
  15. #include <SysInit.hpp>    // Pascal unit
  16. #include <System.hpp>    // Pascal unit
  17.  
  18. //-- user supplied -----------------------------------------------------------
  19.  
  20. namespace Kpcntn
  21. {
  22. //-- type declarations -------------------------------------------------------
  23. typedef int tOLSize;
  24.  
  25. typedef void *TObjects[536870911];
  26.  
  27. typedef void * *pObjects;
  28.  
  29. class DELPHICLASS TObjectList;
  30. #pragma pack(push, 4)
  31. class PASCALIMPLEMENTATION TObjectList : public Classes::TPersistent 
  32. {
  33.     typedef Classes::TPersistent inherited;
  34.     
  35. private:
  36.     bool FDestroy;
  37.     void * *FList;
  38.     int FCount;
  39.     int FCapacity;
  40.     
  41. protected:
  42.     virtual void __fastcall Error(void);
  43.     virtual void __fastcall Grow(void);
  44.     virtual void __fastcall Put(int Index, System::TObject* Item);
  45.     System::TObject* __fastcall Get(int Index);
  46.     void __fastcall SetCapacity(int NewCapacity);
  47.     void __fastcall SetCount(int NewCount);
  48.     void * __fastcall Allocate(int Size);
  49.     virtual void __fastcall FreeItem(void * AnItem);
  50.     
  51. public:
  52.     __fastcall TObjectList(void);
  53.     __fastcall TObjectList(bool DestroyObjects, int InitialCapacity);
  54.     __fastcall virtual ~TObjectList(void);
  55.     virtual int __fastcall AddObject(System::TObject* Item);
  56.     virtual void __fastcall Clear(void);
  57.     void __fastcall Delete(int Index);
  58.     void __fastcall DeleteAll(void);
  59.     void __fastcall FreeAll(void);
  60.     void __fastcall FreeAt(int Index);
  61.     void __fastcall FreeObject(System::TObject* Item);
  62.     virtual int __fastcall IndexOf(System::TObject* Item);
  63.     virtual void __fastcall Insert(int Index, System::TObject* Item);
  64.     void __fastcall Move(int CurIndex, int NewIndex);
  65.     void __fastcall Pack(void);
  66.     __fastcall TObjectList(const AnsiString FileName);
  67.     void __fastcall SaveToStream(const AnsiString FileName);
  68.     void __fastcall LoadFromStream(const AnsiString FileName);
  69.     virtual void __fastcall ReadData(Classes::TStream* S);
  70.     virtual void __fastcall WriteData(Classes::TStream* S);
  71.     virtual void __fastcall DefineProperties(Classes::TFiler* Filer);
  72.     virtual System::TObject* __fastcall First(void);
  73.     virtual System::TObject* __fastcall Last(void);
  74.     virtual System::TObject* __fastcall Next(System::TObject* Item, bool Forward);
  75.     void __fastcall ForEach(void * Action);
  76.     System::TObject* __fastcall LastThat(void * Test);
  77.     System::TObject* __fastcall FirstThat(void * Test);
  78.     __property int Capacity = {read=FCapacity, write=SetCapacity, nodefault};
  79.     __property System::TObject* Items[int Index] = {read=Get, write=Put/*, default*/};
  80.     __property int Count = {read=FCount, nodefault};
  81.     __property bool DestroyObjects = {read=FDestroy, write=FDestroy, nodefault};
  82. };
  83.  
  84. #pragma pack(pop)
  85.  
  86. class DELPHICLASS TAbsMemStream;
  87. #pragma pack(push, 4)
  88. class PASCALIMPLEMENTATION TAbsMemStream : public Classes::TStream 
  89. {
  90.     typedef Classes::TStream inherited;
  91.     
  92. private:
  93.     void *FMemory;
  94.     int FSize;
  95.     int FPosition;
  96.     
  97. public:
  98.     __fastcall TAbsMemStream(void * UseBuf, int MaxSize);
  99.     virtual int __fastcall Read(void *Buffer, int Count);
  100.     virtual int __fastcall Write(const void *Buffer, int Count);
  101.     virtual int __fastcall Seek(int Offset, Word Origin);
  102.     __property int Position = {read=FPosition, nodefault};
  103.     __property void * Memory = {read=FMemory};
  104.     __property int Size = {read=FSize, nodefault};
  105. public:
  106.     #pragma option push -w-inl
  107.     /* TObject.Destroy */ inline __fastcall virtual ~TAbsMemStream(void) { }
  108.     #pragma option pop
  109.     
  110. };
  111.  
  112. #pragma pack(pop)
  113.  
  114. class DELPHICLASS TSortedObjectList;
  115. #pragma pack(push, 4)
  116. class PASCALIMPLEMENTATION TSortedObjectList : public TObjectList 
  117. {
  118.     typedef TObjectList inherited;
  119.     
  120. private:
  121.     Classes::TDuplicates FDuplicates;
  122.     
  123. protected:
  124.     virtual void * __fastcall KeyOf(System::TObject* Item);
  125.     virtual void __fastcall Put(int Index, System::TObject* Item);
  126.     
  127. public:
  128.     __fastcall TSortedObjectList(Classes::TDuplicates WithDuplicates);
  129.     virtual void __fastcall ReadData(Classes::TStream* S);
  130.     virtual void __fastcall WriteData(Classes::TStream* S);
  131.     virtual int __fastcall Compare(void * Key1, void * Key2) = 0 ;
  132.     virtual int __fastcall AddObject(System::TObject* Item);
  133.     virtual bool __fastcall Search(void * Key, int &Index);
  134.     virtual void __fastcall Insert(int Index, System::TObject* Item);
  135.     virtual int __fastcall IndexOf(System::TObject* Item);
  136.     __property System::TObject* Items[int Index] = {read=Get};
  137.     __property Classes::TDuplicates Duplicates = {read=FDuplicates, nodefault};
  138. public:
  139.     #pragma option push -w-inl
  140.     /* TObjectList.CreateWithOptions */ inline __fastcall TSortedObjectList(bool DestroyObjects, int InitialCapacity
  141.         ) : TObjectList(DestroyObjects, InitialCapacity) { }
  142.     #pragma option pop
  143.     #pragma option push -w-inl
  144.     /* TObjectList.Destroy */ inline __fastcall virtual ~TSortedObjectList(void) { }
  145.     #pragma option pop
  146.     #pragma option push -w-inl
  147.     /* TObjectList.CreateFromStream */ inline __fastcall TSortedObjectList(const AnsiString FileName) : 
  148.         TObjectList(FileName) { }
  149.     #pragma option pop
  150.     
  151. };
  152.  
  153. #pragma pack(pop)
  154.  
  155. //-- var, const, procedure ---------------------------------------------------
  156. static const int cMaxList = 0x1fffffff;
  157. extern PACKAGE void __fastcall DoRegisterClass(const void * LoadProc, const void * StoreProc, TMetaClass* 
  158.     Sender);
  159. extern PACKAGE bool __fastcall IsRegistered(TMetaClass* AClass);
  160. extern PACKAGE System::TObject* __fastcall CopyOf(System::TObject* Source);
  161. extern PACKAGE System::TObject* __fastcall ReadObjectFromStream(Classes::TStream* S);
  162. extern PACKAGE void __fastcall WriteObjectToStream(System::TObject* Source, Classes::TStream* S);
  163. extern PACKAGE Word __fastcall RegisterClipBoardType(const AnsiString TypeName);
  164. extern PACKAGE bool __fastcall CopyObjectToClipboard(Word ClipType, System::TObject* Source);
  165. extern PACKAGE System::TObject* __fastcall PasteObjectFromClipboard(Word ClipType);
  166.  
  167. }    /* namespace Kpcntn */
  168. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  169. using namespace Kpcntn;
  170. #endif
  171. #pragma option pop    // -w-
  172.  
  173. #pragma delphiheader end.
  174. //-- end unit ----------------------------------------------------------------
  175. #endif    // kpCntn
  176.